package com.aigao.golf.common.config


/**
 * redis配置
 */
//@Configuration
class RedisConfig{

//    @Bean(name = ["poolConfig"])
//    fun poolConfig():JedisPoolConfig{
//        var poolConig = JedisPoolConfig()
//        poolConig.maxIdle = 200
//        poolConig.maxTotal = 2000
//        poolConig.maxWaitMillis = 30000
//        poolConig.testOnBorrow = true
//        return poolConig
//    }
//
//    @Bean(name = ["redisConnectionFactory"])
//    fun redisConnectionFactory(@Qualifier("poolConfig") poolConfig: JedisPoolConfig):JedisConnectionFactory{
//        var redisConnectionFactory = JedisConnectionFactory()
//        redisConnectionFactory.hostName = "192.168.1.117"
//        redisConnectionFactory.port = 6379
//        redisConnectionFactory.password = "qkjr_420"
//        redisConnectionFactory.database = 0
//        redisConnectionFactory.poolConfig = poolConfig
//        return redisConnectionFactory
//    }
//
//
//    @Bean(name = ["redisTemplate"])
//    fun redisTemplate(@Qualifier("redisConnectionFactory")redisConnectionFactory : JedisConnectionFactory):RedisTemplate<String,Any>{
//        var redisTemplate = RedisTemplate<String,Any>()
//        redisTemplate.connectionFactory = redisConnectionFactory
//        redisTemplate.keySerializer = StringRedisSerializer()
//        redisTemplate.hashKeySerializer = StringRedisSerializer()
//        redisTemplate.valueSerializer = JdkSerializationRedisSerializer()
//        redisTemplate.hashValueSerializer = JdkSerializationRedisSerializer()
//        return redisTemplate
//    }
//
//    @Bean(name = ["shiroRedisConnectionFactory"])
//    fun shiroRedisConnectionFactory(@Qualifier("poolConfig") poolConfig: JedisPoolConfig):JedisConnectionFactory{
//        var connFactory = JedisConnectionFactory()
//        connFactory.hostName = "192.168.1.117"
//        connFactory.port = 6379
//        connFactory.password = "qkjr_420"
//        connFactory.database = 1
//        connFactory.poolConfig = poolConfig
//        return connFactory
//    }
//
//
//    @Bean(name = ["shiroRedisTemplate"])
//    fun shiroRedisTemplate(@Qualifier("shiroRedisConnectionFactory")shiroRedisConnectionFactory : JedisConnectionFactory):RedisTemplate<String,Any>{
//        var redisTemplate = RedisTemplate<String,Any>()
//        redisTemplate.connectionFactory = shiroRedisConnectionFactory
//        redisTemplate.keySerializer = StringRedisSerializer()
//        redisTemplate.hashKeySerializer = StringRedisSerializer()
//        redisTemplate.valueSerializer = JdkSerializationRedisSerializer()
//        redisTemplate.hashValueSerializer = JdkSerializationRedisSerializer()
//        return redisTemplate
//    }
//
//
//    @Bean
//    fun shiroRedisClient(@Qualifier("shiroRedisTemplate") shiroRedisTemplate: RedisTemplate<String,Any>) : ShiroRedisClient{
//        var shiroRedisClient = ShiroRedisClient()
//        shiroRedisClient.redisTemplate = shiroRedisTemplate
//        return shiroRedisClient
//    }





}
